package com.sample.client.ui

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider
import com.sample.client.databinding.ActivityKotlinBinding
import com.sample.client.vm.HttpViewModel

class KotlinActivity : AppCompatActivity() {
    private val binding by lazy { ActivityKotlinBinding.inflate(layoutInflater) }
    private lateinit var viewModel: HttpViewModel

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        viewModel = ViewModelProvider(this)[HttpViewModel::class.java]
        binding.test.setOnClickListener {
            viewModel.load("http://suggest.taobao.com/sug?code=utf-8&q=卫衣&callback=cb")
        }
    }
}